import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:yi_shop/ui/decode/gesture_view.dart';
import 'package:yi_shop/utils/colors.dart';
import 'package:yi_shop/utils/styles.dart';
import 'package:yi_shop/utils/tools.dart';

class MineSettingGestureController extends GetxController {}

class MineSettingGesturePage extends GetView<MineSettingGestureController> {
  const MineSettingGesturePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        leading: ToolsUtils.builderLeading(),
        title: const Text('手势解码'),
      ),
      body: SingleChildScrollView(
        child: Column(
          children: [
            Center(
              child: GestureView(
                immediatelyClear: false,
                size: Get.width * 0.8,
                onPanUp: (List<int> items) {
                  Get.log('items = ${items.toString()}');
                },
                onPanDown: () {},
              ),
            )
          ],
        ),
      ),
      bottomNavigationBar: SafeArea(
        bottom: true,
        child: TextButton(
          onPressed: () {},
          style: ButtonStyle(
              fixedSize: const MaterialStatePropertyAll(Size.fromHeight(50)),
              minimumSize: const MaterialStatePropertyAll(Size.fromHeight(50)),
              padding: const MaterialStatePropertyAll(EdgeInsets.zero),
              alignment: Alignment.center,
              backgroundColor: MaterialStatePropertyAll(
                  ColorsUtils.parseColorFromHexString(ColorsUtils.colorF048)),
              shape: const MaterialStatePropertyAll(LinearBorder())),
          child: Text(
            '确定',
            style: StylesUtils.customTextStyle(fontSize: StylesUtils.fontSize16),
          ),
        ),
      ),
    );
  }
}
